/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.musiqueFaces.beans;

import com.musiqueFaces.data.DataFiller;
import com.musiqueFaces.model.Song;
import java.util.ArrayList;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 *
 * @author peruvien
 */
@ManagedBean
@SessionScoped
public class ManagerSongsBean {
    
    DataFiller dataFiller = new DataFiller();
    ArrayList<Song> listSongs = new ArrayList();
    Song songTampon;

    public ManagerSongsBean() {
        listSongs = dataFiller.getSongList();
    }

    public String updateSong() {
        dataFiller.updateSong(this.songTampon.getId(), this.songTampon.getTitle(), this.songTampon.getText());
        return "/faces/edition/mainPageMusiqueFaces.xhtml";
    }

    public DataFiller getDataFiller() {
        return dataFiller;
    }

    public void setDataFiller(DataFiller dataFiller) {
        this.dataFiller = dataFiller;
    }

    public ArrayList<Song> getListSongs() {
        return listSongs;
    }

    public void setListSongs(ArrayList<Song> listSongs) {
        this.listSongs = listSongs;
    }

    public Song getSongTampon() {
        return songTampon;
    }

    public void setSongTampon(Song songTampon) {
        this.songTampon = songTampon;
    }

    
}
